/*order the name of people in the alphabet order*/
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
main(){
       int n;
       int i,j;
       char name[50][100],orname[50][100],no[50],*temp;
       printf("How many name do you wanna oder?\nInput the numbers of name:");
     scanf("%d",&n);
       fflush(stdin);
       for(i=1;i<=n;i++){
                         printf("Input the name no.%d:",i);
                         scanf("%s",&name[i]);
                         no[i] = name[i];
                         fflush(stdin);
                         }
      for(i=1;i<=5;i++){
                       strcpy(orname[i],name[i]);
                       }
                       for (i=1;i<=n;i++){
                           for(j=i+1;j<=n;j++){
                                              if(strcmp(no[i],no[j])>0){
                                              temp=no[i];
                                              no[i]=no[j];
                                              no[j]=temp;}}}
                                              printf("The sorted list is:");
                                              for(i=1;i<=n;i++){
                                              printf("%d: %s\n", i,no[i]);}
                                               
       getch();
       }
       
